//
//  MLABaseTitleViewController.m
//  MagicLampApp
//
//  Created by Zheng on 2018/12/18.
//  Copyright © 2018 zheng.magic.lamp.app. All rights reserved.
//

#import "MLABaseTitleVC.h"

@interface MLABaseTitleVC ()

@end

@implementation MLABaseTitleVC {
    UILabel *_titleLbl;
}

- (void)viewDidLoad {
    [super viewDidLoad];

    _titleView = [[UILabel alloc] init];
    _titleView.backgroundColor = self.view.backgroundColor;
    [self.view addSubview:_titleView];
    [_titleView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.equalTo(self.view);
        make.height.mas_equalTo(44);
    }];
    
    _titleLbl = [[UILabel alloc] init];
    _titleLbl.font = CX_GetNormalFont(18);
    _titleLbl.textColor = CX_GetColorTitle();
    [self.view addSubview:_titleLbl];
    [_titleLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.top.mas_equalTo(8);
    }];
    
    lineView = [[UIView alloc] init];
    lineView.backgroundColor = CX_GetColorLine();
    [self.view addSubview:lineView];
    [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.equalTo(self.view);
        make.bottom.equalTo(self.titleView).offset(1);
        make.height.mas_equalTo(0.5);
    }];
}

- (void)configTitle:(NSString *)title {
    _titleLbl.text = title;
}

@end
